package com.example.xyxwebbackend001.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "content_block", autoResultMap = true)
public class ContentBlock {
    public enum BlockType {
        HEADING("heading"),
        PARAGRAPH("paragraph"),
        LIST("list");

        @EnumValue
        private final String value;

        BlockType(String value) {
            this.value = value;
        }

        @JsonValue
        public String getValue() {
            return value;
        }
    }
    @TableId(type = IdType.AUTO)
    private Integer blockId;
    private Integer artId;
    @TableField(value = "block_type")
    private BlockType blockType;
    private Integer level;
    private String textContent;
    private String listItems;
    private Integer orderNum;
}
